//
//  KABCosplayModel.h
//  kabu
//
//  Created by XiangDongMBP on 2017/2/4.
//  Copyright © 2017年 East. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <YYModel.h>

#pragma mark - Cos列表
// Cos列表的每一项
@interface KABCosListItem : NSObject<YYModel, NSCoding>
@property (nonatomic, assign) NSInteger cosplayId;          //!< @"id"--@"cosplayId",cosplay项id
@property (nonatomic, assign) NSInteger publisher_id;       //!< 发布者的ID
@property (nonatomic, copy)   NSString *publisher;          //!< 发布者昵称
@property (nonatomic, copy)   NSString *publisher_imageurl; //!< 发布者头像
@property (nonatomic, copy)   NSString *publish_time;       //!< 发布时间
@property (nonatomic, copy)   NSString *publish_address;    //!< 发布地址
@property (nonatomic, copy)   NSString *message;            //!< 文字信息
@property (nonatomic, copy)   NSString *image_url;          //!< 图片地址
@property (nonatomic, assign) NSInteger praise;             //!< 点赞数
@property (nonatomic, assign) BOOL is_praise;               //!< 是否点赞，0-否 1-是
@property (nonatomic, assign) NSInteger total_comment;      //!< 评论数
@property (nonatomic, assign) NSInteger is_collected;       //!< 是否收藏， 0-否 1-是
@property (nonatomic, assign) NSInteger total_collected;    //!< 收藏总数
@property (nonatomic, assign) NSInteger follow_state;       //!< 0:未关注 1:已关注 2:已被对方关注 3:互粉
@property (nonatomic, copy)   NSString *top_content;        //!< 总体文字信息
@property (nonatomic, assign) BOOL is_competition;          //!< 是否是比赛的帖子

@property (nonatomic, readonly) NSAttributedString *topContentLinkAStr;     //!< 总体文字信息转Link字符串
@property (nonatomic, readonly) NSArray<NSString *>*topContentTopicArray;   //!< 总体文字信息的话题数组
@property (nonatomic, readonly) NSArray<NSString *>*topContentTopicAndAtUserArray;  //!< 话题和@用户数组
@end

// Cos列表的模型
@interface KABCosplayModel : NSObject<YYModel, NSCoding>
@property (nonatomic, assign) NSInteger total_rows;         //!< 数据总量
@property (nonatomic, strong) NSMutableArray<KABCosListItem *> *cosplay_list;

@property (nonatomic, readonly) BOOL totalLoad;
- (void)addMoreWithData:(KABCosplayModel *)temp;
- (void)removeCosListItem:(KABCosListItem *)item;
@end

#pragma mark - cos详情
// 发布的cos帖子的每一项图片和文字的模型
@interface KABCosDetPubItem : NSObject
@property (nonatomic, assign) NSInteger pubItemId;          //!< @"id"--@"cosplayId",cosplay项id
@property (nonatomic, copy)   NSString *content;            //!< 文字信息
@property (nonatomic, copy)   NSString *image_url;          //!< cosplay图片链接
@end

// 回复cos帖子的评论的每一项
@interface KABCosDetComItem : NSObject
@property (nonatomic, assign) NSInteger commentId;          //!< @"id"--@"commentId",评论id
@property (nonatomic, assign) NSInteger commentator_id;     //!< 评论人的id
@property (nonatomic, copy)   NSString *commentator;        //!< 评论人
@property (nonatomic, copy)   NSString *commentator_imageurl;//!< 评论人头像
@property (nonatomic, copy)   NSString *content;            //!< 评论内容
@property (nonatomic, copy)   NSString *time;               //!< 评论时间
@property (nonatomic, assign) NSInteger reply_which_id;     //!< 回复某一条评论的id
@property (nonatomic, assign) NSInteger reply_which_user_id;//!< 回复某个用户
@property (nonatomic, copy)   NSString *reply_which_nick_name; //!< 回复某个用户的昵称
@end

// Cosplay详情
@interface KABCosplayDetailVoteInfo : NSObject
@property (nonatomic, assign) NSInteger ballot;        //!< 票数
@property (nonatomic, assign) NSInteger ranking;       //!< 排名
@property (nonatomic, assign) BOOL is_vote;            //!< 是否投票
@end

@interface KABCosplayDetail : NSObject
@property (nonatomic, assign) NSInteger cosplayId;          //!< @"id"--@"cosplayId",cosplay项id
@property (nonatomic, assign) NSInteger publisher_id;       //!< 发布者id
@property (nonatomic, copy)   NSString *publisher;          //!< 发布者昵称
@property (nonatomic, copy)   NSString *publisher_imageurl; //!< 发布者头像
@property (nonatomic, copy)   NSString *publisher_sign;     //!< 发布者的签名
@property (nonatomic, copy)   NSString *publisher_homepage_img_url; //!< 发布者的个人主页的背景图片
@property (nonatomic, copy)   NSString *publish_time;       //!< 发布时间
@property (nonatomic, copy)   NSString *publish_address;    //!< 发布地址
@property (nonatomic, assign) NSInteger follow_state;       //!< 0:未关注 1:已关注 2:已被对方关注 3:互粉
@property (nonatomic, copy)   NSString *top_content;        //!< 总体文字信息
@property (nonatomic, strong) NSMutableArray<KABCosDetPubItem *> *cosplay_detail;
@property (nonatomic, assign) NSInteger praise;             //!< 点赞数
@property (nonatomic, assign) BOOL is_praise;               //!< 是否点赞，0-否 1-是
@property (nonatomic, assign) BOOL is_collected;            //!< 是否收藏， 0-否 1-是
@property (nonatomic, assign) NSInteger total_comment;      //!< 评论数
@property (nonatomic, assign) NSInteger total_collected;    //!< 收藏数
@property (nonatomic, strong) NSMutableArray<KABCosDetComItem *> *comment;
@property (nonatomic, assign) BOOL is_competition;          //!< 是否是比赛的帖子
@property (nonatomic, strong) KABCosplayDetailVoteInfo *vote_info;  //!< 投票信息

@property (nonatomic, readonly) NSAttributedString *topContentLinkAStr;     //!< 总体文字信息转Link字符串
@property (nonatomic, readonly) NSArray<NSString *>*topContentTopicArray;   //!< 总体文字信息的话题数组
@property (nonatomic, readonly) NSArray<NSString *>*topContentTopicAndAtUserArray;  //!< 话题和@用户数组

@property (nonatomic, readonly) BOOL totalLoad;
- (void)addMoreWithData:(KABCosplayDetail *)temp;
- (void)addNewComment:(KABCosDetComItem *)comment;
@end

#pragma mark - 发布Cos
// 发布cos帖子的item
@interface KABCosPublishItem : NSObject
@property (nonatomic, strong) UIImage *img;         //!< 缩略图
@property (nonatomic, strong) NSData *originalData; //!< 原图数据
@property (nonatomic, copy)   NSString *content;    //!< 图片描述
@property (nonatomic, copy)   NSString *image_url;  //!< 上传之后得到的图片连接

- (instancetype)initWithImage:(UIImage *)img originalData:(NSData *)data;

@end

// 发布cos帖子的模型
@interface KABCosPublishModel : NSObject
@property (nonatomic, assign) NSRange cursorPostion;         //!< 光标的位置，用于标记在哪里增加话题字符串
@property (nonatomic, assign) NSInteger topContentMaxLength; //!< top_content最长输入长度
@property (nonatomic, copy)   NSString *top_content;         //!< cos详情
@property (nonatomic, strong) NSMutableArray<KABCosPublishItem *>*cosplay_detail;

@property (nonatomic, readonly) BOOL isImgUpload;
@property (nonatomic, readonly) BOOL isEmpty;
@property (nonatomic, readonly) NSArray<UIImage *> *imgArray;           //!< 缩略图数组
@property (nonatomic, readonly) NSArray<NSData *> *originalImgArray;    //!< 需要上传的图片数据数组
@property (nonatomic, readonly) NSArray<NSString *> *urlArray;          //!< 上传之后的图片连接
//@property (nonatomic, readonly) NSObject *cosplay_detail_json;
- (void)removePublishItemAtIndex:(NSInteger)index;
- (void)addPublishItemsWithImgArray:(NSArray<UIImage *> *)imgArray originalDataArray:(NSArray<NSData *> *)dataArray;
- (void)updateImgUrlWithArray:(NSArray<NSString *> *)array;
- (void)addTopicWithTitle:(NSString *)title;
- (void)addAtUserWithNickname:(NSString *)name;
@end

#pragma mark - 名人榜
@interface KABCosCelListItem : NSObject
@property (nonatomic, assign) NSInteger uid;                //!< 用户id
@property (nonatomic, copy)   NSString *nick_name;          //!< 用户昵称
@property (nonatomic, copy)   NSString *headimg_url;        //!< 名人头像
@property (nonatomic, assign) NSInteger fans_number;        //!< 粉丝数
@property (nonatomic, copy)   NSString *introduce_image_url;//!< 名人简介图片
@property (nonatomic, copy)   NSString *introduce_text;     //!< 名人简介内容
@property (nonatomic, copy)   NSString *province;           //!< 省
@property (nonatomic, copy)   NSString *city;               //!< 城市
@property (nonatomic, assign) NSInteger ranking_id;         //!< 名人榜排行

@property (nonatomic, assign) BOOL isExpanded;              //!< 是否展开的

@end

@interface KABCosplayCelebrity : NSObject
@property (nonatomic, assign) NSInteger total_rows;
@property (nonatomic, strong) NSMutableArray<KABCosCelListItem *> *celebrities;

@property (nonatomic, readonly) BOOL totalLoad;
- (void)addMoreWithData:(KABCosplayCelebrity *)temp;
@end


#pragma mark - cos话题
@interface KABCosplayTopicItem : NSObject
@property (nonatomic, assign) NSInteger cosplaytopic_id;             //!< 话题编号
@property (nonatomic, copy)   NSString *cosplaytopic_content;        //!< 话题内容
@property (nonatomic, copy)   NSString *cosplaytopic_create_time;    //!< 话题发布时间
@property (nonatomic, copy)   NSString *cosplaytopic_cover_img_url;  //!< 话题封面
@property (nonatomic, assign) NSInteger cosplaytopic_user_id;        //!< 话题发布者编号
@property (nonatomic, copy)   NSString *cosplaytopic_user_nickname;  //!< 话题发布者昵称
@property (nonatomic, assign) NSInteger cosplaytopic_cosplay_number; //!< 话题相关帖子数
@end

@interface KABCosplayTopicModel : NSObject
@property (nonatomic, assign) NSInteger total_rows;
@property (nonatomic, strong) NSMutableArray<KABCosplayTopicItem *> *cosplaytopic_list;

@property (nonatomic, readonly) BOOL totalLoad;
- (void)addMoreWithData:(KABCosplayTopicModel *)temp;
@end


#pragma mark - 活动投票情况
@interface KABCosActivityItem : NSObject
@property (nonatomic, assign) NSInteger user_id;           //!< 用户编号
@property (nonatomic, copy)   NSString *user_headimg_url;  //!< 用户头像
@property (nonatomic, copy)   NSString *user_nickname;     //!< 用户昵称
@property (nonatomic, assign) NSInteger cosplay_id;        //!< cosplay编号
@property (nonatomic, assign) BOOL is_voted;               //!< 是否已经投票，0-否 1-是
@property (nonatomic, assign) NSInteger ballot;            //!< 总票数
@property (nonatomic, assign) NSInteger ranking;           //!< 排名
@end

@interface KABCosActivityModel : NSObject
@property (nonatomic, copy)   NSString *activity_name;     //!< 比赛标题
@property (nonatomic, assign) NSInteger total_rows;
@property (nonatomic, strong) NSMutableArray<KABCosActivityItem *> *coser_list;

@property (nonatomic, readonly) BOOL totalLoad;
- (void)addMoreWithData:(KABCosActivityModel *)temp;
@end
